package ch01.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * Created by zc on 2016/10/25.
 */
public class Observer1 implements Observer {

    public void attachObservable(Observable watched){
        watched.addObserver(this);
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println("Data has changed to" + ((SimpleObservable) o).getState());
    }


}
